<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>发表<?php echo $cInfos['typename']; ?>_会员中心_<?php echo $cfg_webname; ?></title>
<link href="templets/style/base.css" rel="stylesheet" type="text/css" />
<link href="../../templets/23ps/style/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="templets/js/j.js"></script>
<script type="text/javascript" src="templets/js/inputAutoClear.js"></script>
<script type="text/javascript" src="templets/js/load.js"></script>
<script type="text/javascript" src="templets/js/leftmenu.js"></script>
<script type="text/javascript" src="templets/js/checkSubmit.js"></script>
<script type="text/javascript">
$(document).ready(function(){

	$('#sf p').eq(1).hide();
	$('#sf .np').focus(function(){
		if($(this).val() == '收费'){
			$('#sf p').eq(1).show();
		}else{
			$('#sf p').eq(1).hide();
		}
	});
	$('#select_1 option').each(function(){
		var _text = $(this).text();
		if( _text == '初级教程' || _text == '提高教程' || _text ==  '高手进阶'){
			$(this).text('【'+_text+'】')
			$(this).css({fontWeight:'bold',color:'#000000'})
			//alert(_text)
		}
	});
	
	$('#select_1').change(function () {
	
		var _text = $(this).find(':selected').text().replace('─','');
		if( _text == '【初级教程】' || _text == '【提高教程】' || _text ==  '【高手进阶】'){
		
			alert('必须选择子栏目！');
		
		}else{
			$('#select_2 .option3:contains('+_text+')').attr('selected','selected');
		}

	}); 

});


</script>


</head>
<body>
<div id="main">
  <?php include(DEDEMEMBER."/templets/head.htm"); ?>
  <div id="content" class="content clearfix">
    <div class="breadcrumbs"><a href="../member/">用户中心</a><span>></span><a href="../member/content_list.php?channelid=1">教程管理</a><span>></span><h1>有偿投稿</h1></div>
    <div id="mcpmain">
      <div id="appTab">
        <ul>
          <li><a href="/member/content_list.php?channelid=1"><span><!--php echo $positionname; -->我的投稿</span></a></li>
          <li class="thisTab"><a href="/member/article_add.php"><span>有偿投稿</span></a></li>
          <li><a href="mypay.php" id="buy">我购买的文章</a></li>
          <li><a href="mystow.php">我收藏的文章</a></li>
        </ul>
        <!--ul>
          <li class="thisTab"><a href="#"><span>发表<?php echo $cInfos['typename']; ?></span></a></li>
        </ul-->        
       </div>
      <form name="addcontent" action="article_add.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();">
          <input type="hidden" name="dopost" value="save" />
          <input type="hidden" name="channelid" value="<?php echo $channelid; ?>" />
      <div id="mainCp">
        <h3 class="meTitle"><strong>发表<?php echo $cInfos['typename']; ?></strong></h3>
        <p align="right"><span style="color:#F00;" >* 所有内容都必须填写</span></p>
        <div class="postForm">
          <p class="cellBg">
            <label><?php echo $cInfos['titlename']; ?>：</label>
            <input name="title" type="text" id="title" value="请输入内容主题" maxlength="100" class="intxt" onfocus="inputAutoClear(this)"/><span style="color:#F00">*</span>
          </p>
          <p>
            <label>标签TAG：</label>
            <input name="tags" type="text" id="tags" maxlength="100" class="intxt"/><span style="color:#F00">*</span>
          </p>
          <p class="cellBg">
            <label>作者：</label>
            <input type="text" name="writer" id="writer" value="<?php echo $cfg_ml->M_LoginID ;?>" maxlength="100" class="intxt" style="width:219px"/><span style="color:#F00">*</span>
          </p>
          <p id="typeid_1">
            <label>隶属栏目：</label>
            <?php
				$typeOptions = GetOptionList(0,$channelid);
				echo "<select id='select_1' name='typeid' size='1'>\r\n";
				echo "<option value='0' selected>请选择栏目...</option>\r\n";
				echo $typeOptions;
				echo "</select>";
			?>
            <span style="color:#F00">*</span>
          </p>
          <p style="position:absolute; top:-11110px;" id="typeid_2">
            <label>隶属副栏目：</label>
            <?php
				$typeOptions = GetOptionList(0,$channelid,range(4,17));
				echo "<select id='select_2' name='typeid2' size='1'>\r\n";
				echo "<option value='0' selected>请选择副栏目...</option>\r\n";
				echo $typeOptions;
				echo "</select>";
			?>
            <span style="color:#F00">*</span>
          </p>
          <!--p class="cellBg">
            <label>我的分类：</label>
            <?php
            	$classlist = classification($cfg_ml->M_ID, 0, $channelid);
            	echo "<select name='mtypesid' size='1'>\r\n";
            	echo "<option value='0' selected>请选择分类...</option>\r\n";
				echo $classlist;
				echo "</select>";
            ?>
            <a href="mtypes.php">添加分类</a>
          </p-->
          <p>
            <label>信息摘要：</label>
            <textarea name="description" id="description"></textarea>(内容的简要说明)<span style="color:#F00">*</span>
          </p>
          <p class="cellBg">
            <label>缩略图：</label>
            <input name="litpic" type="file" id="litpic" onchange="SeePicNew('divpicview',this);"  maxlength="100" class="intxt"/><span style="color:#F00">*</span><span>请限制宽为118px，高为86px.</span>
          </p>
      <div id="sf">
      <?php
       //自定义字段
       PrintAutoFieldsAdd($cInfos['fieldset'],'autofield');
      ?>
      </div>
    </div>
        <!-- 表单操作区域 -->
        <h3 class="meTitle">详细内容</h3>
        <div class="contentShow postForm">
          <p>
          	<?php GetEditor("body","",550,"Member"); ?>
          </p>
      <?php
      if($safe_faq_send == '1'){
      	$faqkey = array_rand($safefaqs);
      ?>
      	 <p class="cellBg">
            <label>验证问题：</label>
            <?php echo $safefaqs[$faqkey]['question'];?> (答案:<?php echo $safefaqs[$faqkey]['answer'];?>)<input name="safeanswer" type="text" id="safeanswer" size="25" style='width:200px;' class="intxt"/> 
                <input type="hidden" name="faqkey" value="<?php echo $faqkey;?>" />
         </p>
      <?php
   		 }
      	//游客强制加验证码，会员则判断后台开关
        if(preg_match("/3/",$safe_gdopen)){
      ?>
          <p class="cellBg">
            <label>验证码：</label>
            <input name="vdcode" type="text" id="vdcode" maxlength="100" class="intxt" style='width:50px;text-transform:uppercase;' />
            <img src="../include/vdimgck.php" alt="看不清？点击更换" align="absmiddle" style="cursor:pointer" onclick="this.src=this.src+'?'" /></p>
      <?php }?>
        <p>
            <button class="button2" type="submit">提交</button>
            <button class="button2 ml10" type="reset" onclick="location.reload();">重置</button>
        </p>
        </div>
      </div>
      </form>
      <!--主操作区域 -->
    </div>
  </div>
<?php include(DEDEMEMBER."/templets/foot.htm"); ?>
</div>
</body>
</html>
